﻿function previous() {
    history.go(-1);
}

function next() {
    var datetime = getQueryVariable("datetime");
    var roomNumber = getQueryVariable("roomnumber");
    var movieName = getQueryVariable("moviename");
    var adultCounter = getQueryVariable("adultcounter");
    var childCounter = getQueryVariable("childcounter");
    var fiftyPlusCounter = getQueryVariable("50pluscounter");
    var cjpStudentCounter = getQueryVariable("cjpstudentcounter");
    var drieDGlassesCounter = getQueryVariable("3dglassescounter");
    var seats = getQueryVariable("seats");

    window.location("printtickets.aspx?datetime=" + datetime + "&roomnumber=" + roomNumber + "&moviename=" + movieName + "&adultcounter=" + adultCounter + "&childcounter=" + childCounter + "&50pluscounter=" + fiftyPlusCounter + "&cjpstudentcounter=" + cjpStudentCounter + "&3dglassescounter=" + drieDGlassesCounter + "&seats=" + seats);
}

function getQueryVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {
            return pair[1];
        }
    }
}